﻿using BCDto.Common.TreeNode;
using BCDto.Sim.Admin.Admin;
using BCDto.Sim.Admin.AdminPermissionMappingPage;
using BCDto.Sim.Admin.TreePermission;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BCService.Sim.Admin.TreePermission
{
    /// <summary>
    /// 树形权限配置记录
    /// </summary>
    public interface ITreePermissionRecordService
    {
        /// <summary>
        /// 添加员工树形权限配置记录
        /// </summary>
        /// <param name="admin">管理员信息</param>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <param name="staffOrganizationMappingRecordId">员工组织映射记录id</param>
        /// <returns></returns>
        TreePermissionRecordDto SettingAdmin(AdminDto admin, long treePermissionConfigId, long staffOrganizationMappingRecordId);

        /// <summary>
        /// 删除员工树形权限配置记录
        /// </summary>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <param name="staffOrganizationMappingRecordId">员工组织映射记录id</param>
        void DeleteAdmin(long treePermissionConfigId, long staffOrganizationMappingRecordId);

        /// <summary>
        /// 添加部门树形权限配置记录
        /// </summary>
        /// <param name="admin">管理员信息</param>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <param name="departmentId">部门id</param>
        /// <returns></returns>
        TreePermissionRecordDto SettingDepartment(AdminDto admin, long treePermissionConfigId, int departmentId);

        /// <summary>
        /// 添加公司树形权限配置记录
        /// </summary>
        /// <param name="admin">管理员信息</param>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <param name="companyId">公司id</param>
        /// <returns></returns>
        TreePermissionRecordDto SettingCompany(AdminDto admin, long treePermissionConfigId, int companyId);

        /// <summary>
        /// 删除部门树形权限配置记录
        /// </summary>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <param name="departmentId">部门id</param>
        void DeleteDepartment(long treePermissionConfigId, int departmentId);

        /// <summary>
        /// 删除部门树形权限配置记录
        /// </summary>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <param name="companyId">公司id</param>
        void DeleteCompany(long treePermissionConfigId, int companyId);

        /// <summary>
        /// 获取树形权限配置记录
        /// </summary>
        /// <param name="companyId">公司ID</param>
        /// <param name="departmentId">部门ID</param>
        /// <param name="adminId">员工ID</param>
        /// <returns></returns>
        IEnumerable<TreePermissionRecordViewDto> GetList(int? companyId, int? departmentId, long? adminId);

        /// <summary>
        /// 获取员工树形权限配置记录
        /// </summary>
        /// <param name="staffOrganizationMappingRecordId">员工部门映射ID</param>
        /// <returns></returns>
        (IEnumerable<TreePermissionConfigDto>, List<PageMenuDto>) GetTreePermissions(long? staffOrganizationMappingRecordId);
        /// <summary>
        /// 获取树形权限模板
        /// </summary>
        /// <param name="companyId">公司Id</param>
        /// <param name="departmentId">部门Id</param>
        /// <param name="staffOrganizationMappingRecordId">员工部门映射记录Id</param>
        /// <returns></returns>
        IEnumerable<TreeNodeDto<TreePermissionConfigDto>> GetPermissionTemplateTree(int? companyId, int? departmentId,long? staffOrganizationMappingRecordId);
    }
}
